﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="CommonNewsEdit.aspx.cs" Inherits="Admin_CommonNewsEdit" Title="南开大学滨海学院新闻网欢迎您"
    ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        #FontSizeSelect
        {
            width: 51px;
        }
        #FontColorSelect
        {
            width: 49px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server" onload="wenden();">
    <!--Content-->





                   
       

<script for=window event=onload>

    window.frames ("titleEditor").document.designMode="On";

</script>


    <tr align="center" valign="top" style="width: 1000px">
        <td>
            <table style="width: 1000px; border: 0px;" cellspacing="0px" cellpadding="0px">
                <tr valign="middle">
                    <!--left-->
                    <td style="width: 70%" valign="top">
                        <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                            <tr style="width: 100%; height: 20px" align="left">
                                <td>
                                    <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                                        <tr style="height: 20px" align="left">
                                            <td style="width: 3%">
                                            </td>
                                            <td style="width: 65px" class="Guide">
                                                <label>
                                                    当前位置：</label>
                                            </td>
                                            <td style="width: 120px" class="Guide">
                                                <a href="AdminHome.aspx">滨海学院新闻网管理</a>
                                            </td>
                                            <td style="width: 20px" class="Guide">
                                                <label>
                                                    ></label>
                                            </td>
                                            <td style="width: 100px" class="Guide">
                                                <asp:HyperLink runat="server" ID="List" NavigateUrl="~/Admin/AdminHome.aspx"></asp:HyperLink>
                                            </td>
                                            <td style="width: 20px" class="Guide">
                                                <label>
                                                    ></label>
                                            </td>
                                            <td class="Guide">
                                                <asp:Label ID="News_Edit" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 1px; background-color: #999999">
                                </td>
                            </tr>
                            <tr style="height: 40px">
                                <td>
                                    <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                                        <tr>
                                        <td style="width: 15%">
                                        </td>
                                        <td>
                                        </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 15%">
                                            </td>
                                            <td align="center">
                                            
     
                                                <asp:Label ID="TitleLabel" runat="server" Font-Size="Medium">标题</asp:Label>
                                            
                                            <table width="300" cellspacing="0" cellpadding="1" border="0" bgcolor="buttonface">
                                              <tr>
                                                <td height="20px" width="22px" onclick='doclick("Bold")' onmouseover='On_Mouseover(this)' onmouseout='On_Mouseout(this)'>
                                                  <img align="absmiddle" id="e_bold" src="..\Edit\images\editor\bold.gif" width="20px" height="20px" border="0">
                                                    </img>
                                                </td>
                                                <td height="20px" width="22px" onclick='doclick("Italic")' onmouseover='On_Mouseover(this)' onmouseout='On_Mouseout(this)'>
                                                  <img align="absmiddle" id="e_italic" src="..\Edit\images\editor\italic.gif" width="20px" height="20px" border="0">
                                                  </img>
                                                </td>
                                                <td height="20px" width="22px" onclick='doclick("underline")' onmouseover='On_Mouseover(this)' onmouseout='On_Mouseout(this)'>
                                                  <img align="absmiddle" id="e_underline" src="..\Edit\images\editor\underline.gif" width="20px" height="20px" border="0">
                                                  </img>
                                                </td>
                                                <td height="20px" width="22px">
                                                    <select id="FontSizeSelect" onchange="ChangeFontSize();">
                                                        <option value=4>4</option>
                                                        <option value=5>5</option>
                                                        <option value=6>6</option>
                                                        <option value=7>7</option>
                                                        <option value=8>8</option>
                                                    </select>
                                                  </img>
                                                </td>
                                               <td height="20px" width="22px" onclick='doclick("underline")' onmouseover='On_Mouseover(this)' onmouseout='On_Mouseout(this)'>
                                                    <select id="FontColorSelect" onchange="ChangeFontColor();">
                                                        <option value="黑">黑</option>
                                                        <option value="红">红</option>
                                                        <option value="绿">绿</option>
                                                        <option value="蓝">蓝</option>
                                                </td>
                                                <td width="300">
                                                  &nbsp;</td>
                                              </tr>
                                                <tr>
                                                  <td colspan="6">
                                                  <!--作为编辑区的iframe-->
                                            <iframe id="titleEditor" frameborder="1" marginheight="0" marginwidth="0" name="titleEditor" 
                                                src="..\Edit\titleEditor.htm" style="width: 300px; height:41px"></iframe>
                                            <input runat="server" type="hidden" name="title" id="title" 
                                                style="width: 300px;"/>
                                                   </td>
                                                </tr>
                                              </table>
                                       
                                                <asp:Label ID="CatalogLabel" runat="server" Text="将其分类到:" Visible="False" 
                                                    Font-Size="Medium"></asp:Label>
                                                <asp:DropDownList ID="DropDownListCatalog" runat="server" Height="25px" Width="149px" 
                                                    DataSourceID="SqlDataSource1" DataTextField="CatalogName" 
                                                    DataValueField="Catalog_id" Enabled="False" Visible="False">
                                                </asp:DropDownList>
                                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                    ConnectionString="<%$ ConnectionStrings:NewsConnectionString %>" 
                                                    
                                                    SelectCommand="SELECT * FROM [Catalog] WHERE ([Catalog_id] &lt;&gt; @Catalog_id2)">
                                                    <SelectParameters>
                                                        <asp:Parameter DefaultValue="1" Name="Catalog_id2" Type="Int32" />
                                                    </SelectParameters>
                                                </asp:SqlDataSource>
                                                </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 1px; background-color: #999999">
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                                        <tr>
                                            <td style="width: 15%">
                                            </td>
                                            <td>
                                                <input runat="server" type="hidden" name="content" id="content" />
                                                <iframe src="../Edit/editor.htm?id=ctl00_ContentPlaceHolder_content&ReadCookie=0"
                                                    style="border: 0px; width: 600px; height: 460px" marginheight="0" marginwidth="0"
                                                    scrolling="no"></iframe>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 1px; background-color: #999999">
                                </td>
                            </tr>
                            
                            <tr>
                                <td>
                                    <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                                        <tr>
                                            <td style="width: 15%">
                                            </td>
                                            <td>
                                                <asp:Label ID="PublishLabel" runat="server">发布</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:CheckBox ID="cbPublish" runat="server" Text="是" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 1px; background-color: #999999">
                                </td>
                            </tr>
                            <tr style="height: 40px">
                                <td>
                                    <table style="width: 100%; border: 0px;" cellspacing="0px" cellpadding="0px">
                                        <tr>
                                            <td style="width: 15%">
                                            </td>
                                            <td style="width: 60px">
                                                <asp:Button runat="server" ID="Submit_Button" CssClass="SubmitButton" Width="38px" Height="21px" BorderWidth="0px" 
                                                onclick="Submit_Button_Click" />
                                            </td>
                                            <td>
                                                <asp:Button runat="server" ID="Return_Button" CssClass="ReturnButton" Width="38px"
                                                    Height="21px" BorderWidth="0px" OnClick="Return_Button_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 1px; background-color: #999999">
                                </td>
                            </tr>
                      
   
<script language="JavaScript">
function add_jy(theform)
{
	theForm.title.value=titleEditor.frames.document.body.innerHTML;
	if(confirm("asdfsdf"))
	{
		return(true);
	}
	else
	return (false);
}



function gettitleEditordata()
{
    var output=window.parent.document.getElementById("ctl00_ContentPlaceHolder_title");
    output.Value=titleEditor.document.body.innerHTML;
}

function doclick(str)
{
var m_objTextRange=titleEditor.document.selection.createRange();
m_objTextRange.execCommand(str);
}


function ChangeFontSize()
{
    o=document.getElementById("FontSizeSelect");
    FS= o.options[o.selectedIndex].value;
    m_objTextRange=titleEditor.document.selection.createRange();
    m_objTextRange.execCommand('FontSize',false,FS);
}

function ChangeFontColor()
{
    o=document.getElementById("FontColorSelect");
    FC= o.options[o.selectedIndex].value;
    m_objTextRange=titleEditor.document.selection.createRange();
    if (FC=="红")
    {
    m_objTextRange.execCommand('ForeColor',false,"#ff0000");
    }
    else if (FC=="绿")
    {
    m_objTextRange.execCommand('ForeColor',false,"#00ff00");
    }
    else if (FC=="蓝")
    {
    m_objTextRange.execCommand('ForeColor',false,"#0000ff");
    }
    else if (FC=="黑")
    {
    m_objTextRange.execCommand('ForeColor',false,"#000000");
    }
}

function On_Mouseover(thisTD)
{
  thisTD.style.borderLeft="1px solid";
  thisTD.style.borderRight="1px solid";
  thisTD.style.borderTop="";
  thisTD.style.borderBottom="";
}


function On_Mouseout(thisTD)
{
  thisTD.style.borderLeft="";
  thisTD.style.borderRight="";
  thisTD.style.borderTop="";
  thisTD.style.borderBottom="";
}


function InitTitleEditorContain()
{
	titleEditor.frames.document.body.innerHTML="this";
	//=theForm.title.value;
}
//-->


//表单提交函数
function titleEditorAttachSubmit(){
    title=window.document.getElementById("ctl00_ContentPlaceHolder_title");
    title.value=window.frames ("titleEditor").document.body.innerHTML;
}

//附件提交和重置信息
if (window.attachEvent)
{
     //IE 的事件代码
    submitbuttom=window.document.getElementById("ctl00_ContentPlaceHolder_Submit_Button");
    submitbuttom.attachEvent("onclick",titleEditorAttachSubmit);
}
else
{
     //其它浏览器的事件代码
    submitbuttom=window.document.getElementById("ctl00_ContentPlaceHolder_Submit_Button");
    submitbuttom.addEventListener("submit",titleEditorAttachSubmit);
}

</script>
                      
</asp:Content>
